package com.shopnight.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 用户地址表
 * @TableName shop_address
 */
@TableName(value ="shop_address")
@Data
public class ShopAddress implements Serializable {
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 用户id
     */
    private Integer userId;

    /**
     * 楼栋
     */
    private String oneSite;

    /**
     * 楼层
     */
    private String twoSite;

    /**
     * 室号
     */
    private String threeSite;

    /**
     * 收货人
     */
    private String consignee;

    /**
     * 收货人手机号
     */
    private String consigneePhone;

    /**
     * 详细地址
     */
    private String detailedAddress;

    /**
     * 是否默认地址[0 否 1是]
     */
    private Integer checked;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ShopAddress other = (ShopAddress) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getOneSite() == null ? other.getOneSite() == null : this.getOneSite().equals(other.getOneSite()))
            && (this.getTwoSite() == null ? other.getTwoSite() == null : this.getTwoSite().equals(other.getTwoSite()))
            && (this.getThreeSite() == null ? other.getThreeSite() == null : this.getThreeSite().equals(other.getThreeSite()))
            && (this.getConsignee() == null ? other.getConsignee() == null : this.getConsignee().equals(other.getConsignee()))
            && (this.getConsigneePhone() == null ? other.getConsigneePhone() == null : this.getConsigneePhone().equals(other.getConsigneePhone()))
            && (this.getDetailedAddress() == null ? other.getDetailedAddress() == null : this.getDetailedAddress().equals(other.getDetailedAddress()))
            && (this.getChecked() == null ? other.getChecked() == null : this.getChecked().equals(other.getChecked()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getOneSite() == null) ? 0 : getOneSite().hashCode());
        result = prime * result + ((getTwoSite() == null) ? 0 : getTwoSite().hashCode());
        result = prime * result + ((getThreeSite() == null) ? 0 : getThreeSite().hashCode());
        result = prime * result + ((getConsignee() == null) ? 0 : getConsignee().hashCode());
        result = prime * result + ((getConsigneePhone() == null) ? 0 : getConsigneePhone().hashCode());
        result = prime * result + ((getDetailedAddress() == null) ? 0 : getDetailedAddress().hashCode());
        result = prime * result + ((getChecked() == null) ? 0 : getChecked().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", oneSite=").append(oneSite);
        sb.append(", twoSite=").append(twoSite);
        sb.append(", threeSite=").append(threeSite);
        sb.append(", consignee=").append(consignee);
        sb.append(", consigneePhone=").append(consigneePhone);
        sb.append(", detailedAddress=").append(detailedAddress);
        sb.append(", checked=").append(checked);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}